<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>支付结果</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            user-select: none;
        }

        html,
        body {
            width: 100%;
            height: 100%;
        }

        .wrap {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-around;
            padding: 100px 0;
        }

        .img {
            width: 72px;
            height: 72px;
        }

        .zhifu-text {
            font-weight: 500;
            font-size: 20px;
            margin-top: 16px;
        }

        .top {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .tips {
            color: #9B9B9B;
            font-size: 14px;
        }

        .bottom {
            width: 216px;
            height: 48px;
            background: linear-gradient(90deg, #92D982 0%, #8EE88A 49%, #F4F36E 100%);
            border-radius: 58px 58px 58px 58px;
            line-height: 48px;
            text-align: center;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div class="top">
            <img src="./image@2x.png" class="img" alt="">
            <div class="zhifu-text">支付成功</div>
            <div class="tips">您已经完成支付</div>
        </div>

        <div class="bottom" onclick="func()">返回富乐万家</div>
    </div>
</body>

<script>
    function func() {
        // 判断是那种设备
        let u = navigator.userAgent;
        console.log(u);
        var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; // Android系统或者uc浏览器
        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // iOS系统

        // 如果为Android系统
        if (isAndroid) {
            window.location.href = "fulewanjia://"
            return;
        }

        // ios设备：原理：判断是否认识这个协议，认识则直接跳转，不认识就在这里下载appios();
        /*
        if (isiOS) {
          let startIndex = u.indexOf("iPhone OS") + 9;
          let endIndex = u.indexOf("like Mac OS") - 1;
          let num = +u.slice(startIndex, endIndex).split("_")[0]; // 计算版本号的前面数值
          if (num < 9) {
            window.location.href = "hbuilder://?auth_code=" + code; //  注意*** 这里需要修改为刚刚设置的urlscheme，auth_code需要后端拼接。auth_code只有后端才能拿到
          } else {
            window.location.href = " "; // universal link 链接
          }
          window.setTimeout(function () {
            window.location.href = " "; // 3s后如果不能跳转到 App，则跳转到 AppStore 的下载地址
          }, 3000);
          return;
        }
        */
    }
</script>

</html>